import { createRouter, createWebHistory } from "vue-router";
import routes from "./config.ts";

console.log(import.meta.env.BASE_URL);
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
    linkActiveClass: 'active'
})

router.beforeEach((to, from, next)=> {
    console.log(to, from, next);
    if(!to.meta.needLogin) {
        next();
        return;
    }
    document.body.innerHTML = "登陆后重试！"
})

export default router;